Fix deletion of text holding `inhibit-read-only' properties
authorPo Lu <luangruo@yahoo.com>
Tue, 30 Apr 2024 10:26:39 +0000 (18:26 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 30 Apr 2024 10:28:05 +0000 (18:28 +0800)
commitb36fd07560fd12c5e819e808a6f0eb9579f77c25
tree81de96a5c2b3c0f5e0465a028c8c6b98e4e65ce0
parentaad80e1934f09b643b93aeb3bf9c1d583af6e2ec
Fix deletion of text holding `inhibit-read-only' properties

* src/intervals.h (INTERVAL_VISIBLE_P): Split into ...
(INTERVAL_GENERALLY_WRITABLE_P, INTERVAL_EXPRESSLY_WRITABLE_P):
... two new macros.

* src/textprop.c (verify_interval_modification): If the buffer
is read only, verify not that there is only a single exempting
interval spanning the area of a multiple-character operation,
but that every intervening interval in such an operation exempts
it from write restrictions, either by providing a read-only
property that appears in Vinhibit_read_only, or by providing an
inhibit-read-only property.

* test/src/textprop-tests.el (textprop-interval-immutability):
New test.
src/intervals.h
src/textprop.c
test/src/textprop-tests.el